home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inventor Labs: Technology
/
INVENTORLABS_TECHNOLOGY.BIN
/
pc
/
files
/
invest.dir
/
00325_Script_Inv Sound Obj
< prev
next >
Wrap
Text File
|
1997-05-26
|
11KB
|
357 lines
--Inv Sound Obj
Property pC, pE, pG, pZ, pMixDataIndex, pPuppetSpriteList, pFirstQTmixCastNum
property pCurrentBinaryIndex, pFirstButtonSprite, pFirstWaveBoxSprite
property pFirstWavePicCastNum, pFirstSndCastNum, pFirstWaveSprite
property pMixBoxRect, pRedrawSprite, pQTsprite, pMixedToneList, pMixDisplayState
property pMixCastIndex, pWavePictSpriteNum, pMixable
property pQTFlag
----------------------------------------------------------ò
on mInit me
set pFirstButtonSprite = 3
set pFirstWaveBoxSprite = 9
set pQTsprite = 23
set pRedrawSprite = 13
set pFirstWaveSprite = 14
set pWavePictSpriteNum = 18
set pFirstQTmixCastNum = the number of cast "ce.mov"
set pFirstWavePicCastNum = the number of cast "ce.pic"
set pFirstSndCastNum = the number of cast "CE.AIF"
set pPuppetSpriteList = [pQTsprite, pFirstWaveSprite, pFirstWaveSprite+ 1, pFirstWaveSprite +2 , pFirstWaveSprite +3, pRedrawSprite, pWavePictSpriteNum]
set pMixBoxRect = rect(407, 86, 627, 167)
--put "pMixBoxRect" && pMixBoxRect
mActivate(me)
return me
end mInit
----------------------------------------------------------ò
on mActivate me
repeat with x in pPuppetSpriteList
puppetSprite x, true
end repeat
set the text of cast "Mixed Tone List" = ""
set pMixDisplayState = false
set pMixCastIndex = 0
set pCurrentBinaryIndex = 0
set pMixedToneList = []
set pC = false
set pE = false
set pG = false
set pZ = false
set pMixable = false
--set the visible of sprite pQTsprite = false
set the locH of sprite pQTsprite = -500-- 517 or - 500
set pMixDataIndex = [:]
set DataBase = the text of cast "Sound Mixing Database"
set Limit = the number of lines in DataBase
repeat with x = 1 to Limit
set myLine = line x of DataBase
if char 1 of myLine = "#" then
set ToneCombo = value(item 1 of myLine)
set BinaryIndex = value(item 2 of myLine)
setaProp(pMixDataIndex, ToneCombo, BinaryIndex)
end if
end repeat
--put "pMixDataIndex = " & pMixDataIndex
--\
global gTest
set gTest = pMixDataIndex
end mActivate
----------------------------------------------------------ò
on mClose me
repeat with x in pPuppetSpriteList
puppetSprite x, false
end repeat
--tj&dl
repeat with n = 2 to 33
set the puppet of sprite n = 0
set the visible of sprite n = 1
end repeat
puppetsprite 33, false
end mClose
----------------------------------------------------------ò
on mStartAgain me
repeat with x = pFirstWaveSprite to (pFirstWaveSprite + 3)
set the locH of sprite x = -500
updateStage
end repeat
set pC = false
set pE = false
set pG = false
set pZ = false
end mStartAgain
----------------------------------------------------------ò
on mSetBinaryIndex me
set pCurrentBinaryIndex = 0
if pC then set pCurrentBinaryIndex = pCurrentBinaryIndex + 1000
if pE then set pCurrentBinaryIndex = pCurrentBinaryIndex + 100
if pG then set pCurrentBinaryIndex = pCurrentBinaryIndex + 10
if pZ then set pCurrentBinaryIndex = pCurrentBinaryIndex + 1
end mSetBinaryIndex
----------------------------------------------------------ò
on mQuickDrawRedraw me
set the rect of sprite pRedrawSprite = pMixBoxRect
set the visible of sprite pRedrawSprite = false
set the visible of sprite pRedrawSprite = true
updateStage
--set the locH of sprite pRedrawSprite = - 400
end mQuickDrawRedraw
----------------------------------------------------------ò
on mWaveClick me
set NoteStateList = [pC, pE, pG, pZ]
set index = the clickon - pFirstWaveBoxSprite
set DroppedInTheBox = false
--CLEAR OUT PREVIOUSLY MIXED SOUND WAVES
if pMixDisplayState = #DisplayingPict or pMixDisplayState = #DisplayingQT then
set the locH of sprite pQTsprite = -500-- 517 or - 500
set the locH of sprite pWavePictSpriteNum = - 400
set pMixDisplayState = 0
mQuickDrawRedraw(me)
set pC = 0
set pE = 0
set pG = 0
set pZ = 0
set pMixable = 0
end if
if getAt(NoteStateList, (index + 1)) = 0 then
repeat while the mouseDown
set the locH of sprite (pFirstWaveSprite + index) = the mouseH
set the locV of sprite (pFirstWaveSprite + index) = the mouseV
updateStage
end repeat
if the mouseH > getAt(pMixBoxRect, 1) and the mouseH < getAt(pMixBoxRect, 3) then
if the mouseV > getAt(pMixBoxRect, 2) and the mouseV < getAt(pMixBoxRect, 4) then
set DroppedInTheBox = true
set pMixable = true
end if
end if
if DroppedInTheBox then
set the locH of sprite (pFirstWaveSprite + index) = 517
set the locV of sprite (pFirstWaveSprite + index) = 127
updateStage
if index = 0 then
set pC = true
else if index = 1 then
set pE = true
else if index = 2 then
set pG = true
else if index = 3 then
set pZ = true
end if
else if not DroppedInTheBox then
set the locH of sprite (pFirstWaveSprite + index) = -400
end if
end if
end mWaveClick
----------------------------------------------------------ò
on mButtonClick me
set buttonIndex = the clickOn - pFirstButtonSprite + 1
put "BUTTON INDEX:" && buttonIndex
if buttonIndex < 5 then
mPlayTone(me, buttonIndex)
else if buttonIndex = 5 then
mMixTones(me)
else if buttonIndex = 6 then
mPlayMixedTone(me)
end if
end mButtonClick
----------------------------------------------------------ò
on mPlayTone me, aWhichTone
set SoundToPlay = the name of cast (pFirstSndCastNum + 10 + aWhichTone)
puppetSound SoundToPlay
end mPlayTone
----------------------------------------------------------ò
on mMixTones me
set Test = pZ + pC + pG + pE
if Test <= 1 then
else
mSetBinaryIndex(me)
set FoundaMatch = false
set counter = 1
if pMixable then
if pCurrentBinaryIndex <> 0 then
repeat while not FoundaMatch
set x = getAt(pMixDataIndex, counter)
if getAt(pMixDataIndex, counter) = pCurrentBinaryIndex then
set FoundaMatch = true
set MixLabel = getPropAt(pMixDataIndex, counter)
set pMixCastIndex = counter
end if
set counter = counter + 1
end repeat
end if
--tj&dl
if pQTFlag = #NOQT then
nothing
else
mPlayMixQT(me, MixLabel)
end if
set pQTFlag = #DEFAULT
end if
end if
end mMixTones
----------------------------------------------------------ò
on mPlayMixQT me, aMixLabel
set MixToPlay = pFirstQTmixCastNum + pMixCastIndex - 1
put "MixToPlay =" && MixToPlay
put "pFirstQTmixCastNum" && pFirstQTmixCastNum
put "pMixCastIndex" && pMixCastIndex
put "The castNumber of the QTFile to play is:" && MixToPlay
set x = the name of cast MixToPlay
put "the name of cast MixToPlay" && x
if the castType of cast MixToPlay = #digitalvideo then
set the castNum of sprite pQTsprite = value(MixToPlay)
put "the castNum of sprite pQTsprite: " & the castNum of sprite pQTsprite
set the movieTime of sprite pQTsprite = 0
repeat with x = 0 to 3
set the locH of sprite pFirstWaveSprite + x = - 400
end repeat
set the locH of sprite pQTsprite = 517-- 517 or - 500
updateStage
set the movieRate of sprite pQTsprite = 1
set pMixDisplayState = #DisplayingQT
if getPos(pMixedToneList, string(aMixLabel)) = 0 then
add(pMixedToneList, string(aMixLabel))
end if
--put "pMixedToneList" && pMixedToneList
set TextBuilder = ""
repeat with x = 1 to count(pMixedToneList)
put getAt(pMixedToneList, x) into line x of TextBuilder
end repeat
set the text of cast "Mixed Tone List" = TextBuilder
end if
end mPlayMixQT
----------------------------------------------------------ò
on mPlayMixedTone me
--tj&dl -- awful hack!
set NumberOfMixedTones = 0
if pC = 1 then set NumberOfMixedTones = NumberOfMixedTones + 1
if pE = 1 then set NumberOfMixedTones = NumberOfMixedTones + 1
if pG = 1 then set NumberOfMixedTones = NumberOfMixedTones + 1
if pZ = 1 then set NumberOfMixedTones = NumberOfMixedTones + 1
if NumberOfMixedTones = 1 then
if pC = 1 then set NewIndex = 1
else if pE = 1 then set NewIndex = 2
else if pG = 1 then set NewIndex = 3
else if pZ = 1 then set NewIndex = 4
mPlayTone me, NewIndex
else
set pQTFlag = #NOQT
mMixTones(me)
set SoundToPlay = the name of cast (pFirstSndCastNum + pMixCastIndex - 1)
puppetSound cast SoundToPlay
end if
end mPlayMixedTone
----------------------------------------------------------ò
on mFrameLoop me
if pMixDisplayState = #DisplayingQT then
if the movieRate of sprite pQTsprite = 0 then
mSwapQTforPict(me)
set pMixDisplayState = #DisplayingPict
end if
end if
go the frame
end mFrameLoop
----------------------------------------------------------ò
on mSwapQTforPict me
--set the visible of sprite pQTsprite = 0
set the locH of sprite pQTsprite = -500 -- 517 or -500
set NewPictCastNum = pMixCastIndex + pFirstWavePicCastNum - 1
set the castNum of sprite pWavePictSpriteNum = NewPictCastNum
set the locH of sprite pWavePictSpriteNum = 517
set the locV of sprite pWavePictSpriteNum = 127
mQuickDrawRedraw(me)
updateStage
end mSwapQTforPict
----------------------------------------------------------ò
on PlayFromMixedToneList me
set WhichLine = the mouseLIne
set TheText = word 1 of line WhichLine of field "Mixed Tone List"
set NumberOfChars = the number of chars of TheText
put "NumberOfChars:" && NumberOfChars
set pZ = 0
set pG = 0
set pE = 0
set pC = 0
repeat with n = 1 to NumberOfChars
set nextLetter = char n of TheText
put nextLetter && charToNum(nextLetter)
if nextLetter = "C" then
set pZ = 1
put "C"
else if nextLetter = "g" then
set pG = 1
put "G"
else if nextLetter = "e" then
set pE = 1
put "E"
else if nextLetter = "c" then
set pC = 1
put "Small C"
end if
end repeat
-- put "PlayFrom:" && "C:" && TempC && "E:" && TempE && "G:" && TempG && "c:" && TempZ
-- set TempBinaryIndex = 0
-- if TempC then set TempBinaryIndex = TempBinaryIndex + 1000
-- if TempE then set TempBinaryIndex = TempBinaryIndex + 100
-- if TempG then set TempBinaryIndex = TempBinaryIndex + 10
-- if TempZ then set TempBinaryIndex = TempBinaryIndex + 1
--
-- set FoundaMatch = false
-- set counter = 1
-- if pCurrentBinaryIndex <> 0 then
-- repeat while not FoundaMatch
-- set x = getAt(pMixDataIndex, counter)
-- if getAt(pMixDataIndex, counter) = TempBinaryIndex then
-- set FoundaMatch = true
-- set MixLabel = getPropAt(pMixDataIndex, counter)
-- -- set pMixCastIndex = counter
-- end if
-- set counter = counter + 1
-- end repeat
mPlayMixedTone me
-- mPlayMixQT(me, MixLabel)
end if
end
----------------------------------------------------------ò